/**
 * Copyright:Copyright(c)2014-2017
 * Company:厦门市易致达物联网科技有限公司
 * @version 1.0
 */
package shop.services.front.rank.dao.impl;

import java.util.List;

import shop.core.common.dao.BaseDao;
import shop.core.common.dao.page.PagerModel;
import shop.services.front.rank.bean.Rank;
import shop.services.front.rank.dao.RankDao;
import org.springframework.stereotype.Repository;

import javax.annotation.Resource;

/**
 * @类名称：RankDaoImpl
 * @创建人：Ltz
 * @创建时间：2017-10-13 下午16:10:42  
 * @版本号：1.0
 * @描述：
 */
@Repository("rankDaoFront")
public class RankDaoImpl  implements RankDao {

    @Resource
    private BaseDao dao;

    public void setDao(BaseDao dao) {
        this.dao = dao;
    }

    public PagerModel selectPageList(Rank e) {
        return dao.selectPageList("front.rank.selectPageList","front.rank.selectPageCount", e);
    }

    public List selectList(Rank e) {
        return dao.selectList("front.rank.selectList", e);
    }

    public Rank selectOne(Rank e) {
        return (Rank) dao.selectOne("front.rank.selectOne", e);
    }

    public int delete(Rank e) {
        return dao.delete("front.rank.delete", e);
    }

    public int update(Rank e) {
        return dao.update("front.rank.update", e);
    }

    public int deletes(String[] ids) {
        Rank e = new Rank();
        for (int i = 0; i < ids.length; i++) {
            e.setId(ids[i]);
            delete(e);
        }
        return 0;
    }

    public int insert(Rank e) {
        return dao.insert("front.rank.insert", e);
    }

    public int deleteById(int id) {
        return dao.delete("front.rank.deleteById", id);
    }

    @Override
    public Rank selectById(String id) {
        return (Rank) dao.selectOne("front.rank.selectById", id);
    }

    @Override
    public List<Rank> selectRankList(Rank rank) {
        return dao.selectList("front.rank.selectRankList", rank);
    }
}

